/*

 * TOP SECRET
 * Copyright 2006-2015 Transsion.com All right reserved. This software is the
 * confidential and proprietary information of Transsion.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Transsion.com.
 */
package com.yunji.framework_template.orm.persistence.jpa;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.yunji.framework_template.orm.persistence.model.Test;
/** 
 * ClassName:TestDao <br/> 
 * Date:     2018年9月25日 下午4:10:47 <br/> 
 * @author   fenglibin1982@163.com 
 * @version  
 * @see       
 */
public interface TestDao extends JpaRepository<Test,Integer>{
    public Test findFirstBy();
    
    public List<Test> findByVal(String val);
    
    public List<Test> findByBigType(String bigType);
    
    public List<Test> findByBigTypeOrderByModified(String bigType);
    
    public List<Test> findByBigTypeAndSmallType(String bigType,String smallType);
    
    // Query的使用，可查看Blog https://www.cnblogs.com/zj0208/p/6008627.html
    @Query(nativeQuery = true, value = "select t.* from test t order by id")
    public List<Test> searchAll();
    
    @Query(nativeQuery = true, value = "select t.* from test t where id= :id")
    public Test searchById(@Param("id") Integer id);
}
